<?php
switch ($_REQUEST["AUnit"]){
    case "load_new_content":
        include '../Module/newsModule.php';
        $newModule=new newsModule();
        include '../Pages/04_01_new.php';
        break;
    case "more":
        include '../Pages/08_more.php';
        break;
    case "04_about":
        include '../Admin/04_about.php';
        break;
    case "05_detail":
        include '../Admin/05_detail.php';
        break;
    case "06_product":
        include '../Admin/06_product.php';
        break;
    case "06_1_product_detail":
        include '../Module/ProductModule.php';
        include '../Admin/06_1_product_detail.php';
        break;
    case "07_system":
        include '../Admin/07_system.php';
        break;
    case "10_gallery":
        include '../Admin/10_gallery.php';
        break;
    case "11_gallery_detail":
        include '../Admin/11_gallery_detail.php';
        break;
    case "item":
        include '../Admin/item.php';
        break;
    case "summary":
        include '../Admin/02_summary.php';
        break;
    case "itemdetail":
        include '../Admin/itemdetail2.php';
        break;
    case "upload":
        include '../Admin/ajax-file-upload/index.php';
        break;
    case "loadfolder":
            $_SESSION["UPLOADFOLDER"]=$_REQUEST["folder"];
            $uploaddir=$_SESSION["UPLOADFOLDER"];
            $files = array();
            $dir = opendir("../".$uploaddir);
            while ($f = readdir($dir)){
            if(eregi("\.jpg|\.gif|\.png",$f))
            array_push($files,$f);
            }
            closedir($dir);
            $data = array();
            if(!empty($files)){
            foreach ($files as $k => $v){
            echo "
                <div class='item success'>
                    <img src='$uploaddir/$v' width=160 />
                    <div>$v</div>
                    <div><input type='text' value='$uploaddir/$v'/></div>
                </div>
            ";
            }
            }else echo "No image.";
        break;
    default :
        echo '<div style="padding:0 20px">
                <div id="mini_inner" class="centered">
                <img src="images/icon/48/dialog_warning.png" alt="" height="50" class="alert">
                <h1>Error 404:Oh no! Chúng tôi không tìm thấy trang bạn yêu cầu</h1>
                <p>Hãy kiểm tra lại đường dẫn, có thể sai chỉnh tả, hoặc phân biệt hoa thường...</p>
                </div>
                </div>';
}
?>
